package com.ExaminStudy;

import java.util.Scanner;

public class MaxMain {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请你输入");
        int n=sc.nextInt();
        int[]a=new int[n];
        for (int i = 0; i <a.length; i++) {
            System.out.println("请输入");
            a[i]=sc.nextInt();
        }
      int max=a[0];
        int min=a[0];
        for (int i = 1; i <a.length ; i++) {
            if(max>a[i]){
                max=max;
        }else{
                max=a[i];
            }
            if(min<a[i]){
                min=min;
            }else{
                min=a[i];
            }
        }
        System.out.println("最大值是"+max);
        System.out.println("最小值是"+min);
    }
}
